﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZSZ.DTO;

namespace ZSZ.Iservice
{
   public interface IPermissionService:IServiceSupport
    {
        void Update(long id,string name,string miaoshu);
        long AddNew(string name,string miaoshu);
        PermissionDTO GetById(long id);
        PermissionDTO[] GetAll();
        PermissionDTO GetByName(string name);
        PermissionDTO[] GetByRoleId(long roleId);
        void MarkDeleted(long id);
        /// <summary>
        /// 给角色增加权限项
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="permIds"></param>
        void AddPermIds(long roleId,long[] permIds);
        /// <summary>
        /// 更新角色role的权限项：先删除再添加
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="permIds"></param>
        void UpdatePermIds(long roleId,long[] permIds);
    }
}
